﻿using Microsoft.VisualBasic;
using System.Windows;

namespace CommonUtils
{
    public static class MessageUtil
    {
        //Show/Tip使用的引用不一样,但是好像没啥区别
        public static void Show(object value, params object[] args)
        {
            var message = value.ToString();
            if (args.Length > 0)
                message = message.Format(args);
            MessageBox.Show(message, "窗口提示");
        }

        public static void Tip(object value, params object[] args)
        {
            var message = value.ToString();
            if (args.Length > 0)
                message = message.Format(args);
            System.Windows.Forms.MessageBox.Show(message, "窗体提示");
        }

        public static string ShowInput(string tip, string input)
        => Interaction.InputBox(tip, "系统提示", input);

        public static string ShowInput(string input)
        => Interaction.InputBox("请输入或复制:", "系统提示", input);

        public static string GetInput(string tip, string input = null)
        => ShowInput(tip, input);
    }
}
